﻿@using DirigoEdge.PluginFramework
@using DirigoEdge.Utils
@using SquishIt.Framework

<!DOCTYPE html>
<!--[if lt IE 7 ]> <html class="ie ie6 no-js" lang="en"> <![endif]-->
<!--[if IE 7 ]>    <html class="ie ie7 no-js" lang="en"> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" ><![endif]-->
<!--[if IE 8 ]>    <html class="ie ie8 no-js" lang="en"> <![endif]-->
<!--[if IE 9 ]>    <html class="ie ie9 no-js" lang="en"> <![endif]-->
<!--[if gt IE 9]><!-->
<html class="no-js" lang="en">
<!--<![endif]-->

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    @* ** Sets the viewport width to device-width. sets initial zoom level to 100% **@
    <meta name="viewport" content="width=device-width, initial-scale=1">
        
    <title>@ViewBag.Title</title>

    @* ** Basic Meta Information ** *@
    @{
        string metaDescription = ViewBag.MetaDesc ?? "";
    }
    <meta name="description" content="@metaDescription">
    <meta name="robots" content="all" />
    
    @* ** Facebook OG tags ** *@
    @{
        var oGType = ViewBag.OGType ?? "article";
        var oGTitle = ViewBag.OGTitle ?? "";
        var oGImage = ViewBag.OGImage ?? "";
        var oGUrl = ViewBag.OGUrl ?? "";
    }
    
    @if (!String.IsNullOrEmpty(oGTitle))
    {
        <meta property="og:title" content="@oGTitle" />
        <meta property="og:type" content="@oGType" />
        <meta property="og:image" content="@oGImage" />
        <meta property="og:description" content="@metaDescription" />
        <meta property="og:url" content="@oGUrl" />
    }
    
    @RenderSection("Meta", false)
    
    @Html.DoAction("head")
    
    @Html.DoAction("head_layout")
    
    @if (UserUtils.UserIsAdmin())
    {
        @Html.DoAction("head_logged_in")
    }
    
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300' rel='stylesheet' type='text/css'>

    @{ string style = SquishIt.Framework.Bundle.Css()
                              .Add("~/Content/themes/base/css/normalize.css")
                              .Add("~/Content/themes/base/css/base.css")
                              .Add("~/Content/themes/base/css/foundation.css")
                              .Add("~/Content/themes/base/css/common.css")
                              .Add("~/Content/themes/base/site.css")
                              .Add("~/Content/themes/base/css/mediaqueries.css")
                              .Add("~/Content/themes/base/css/print.css")
                              .Add("~/Content/themes/base/css/blog.css")
                              .Add("~/Content/themes/base/css/msftStyles.css") // Styles for membership framework validation errors, etc.
                              .Render("~/CSS/combined_#.css");
    }
    @Html.Raw(style)
    
    <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">

    @RenderSection("Styles", false)

    @* Modernizr stays in <head> *@
    <script src="@Url.Content("~/Scripts/modernizr-2.8.2.min.js")" type="text/javascript"></script>

    <!-- Google Analytics: change UA-XXXXX-X in site admin to be your site's ID. -->
    @Html.Partial("Partials/GoogleAnalyticsPartial")
</head>
    
@{
    bool userIsAdmin = UserUtils.UserIsAdmin();
}
<body>
        <!--[if lt IE 8]>
            <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
        <![endif]-->

        @{
            // Load Facebook api if we need it
            // Currently only FB Comments needs the API
            if (SiteSettingsUtils.ShowFbComments())
            {
                // Grid overlay partial allows a transparent grid to be overlayed the screen
                Html.RenderPartial("FacebookAPIInclude");
            }

            // ** Admins Get Grid Overlay **
            // Load Grid Overlay so devs can easily see if their layout is correct
            if (userIsAdmin)
            {
                // Grid overlay partial allows a transparent grid to be overlayed the screen
                Html.RenderPartial("GridLayoutOverlayPartial");
            }
        }

    <!-- Header and Nav -->
    <header class="row">
        @Html.RenderUserContentModuleWithCodeEditor("header") 
    </header>

        <!-- Body Content -->
        <section id="Main">
            @RenderBody()
        </section>

        <!-- Footer -->
        <footer class="row">
            <div class="twelve columns">
                <hr />
                <div class="row">
                    <div class="six columns">
                        <p>&copy; Copyright no one at all. Go to town.</p>
                    </div>
                    <div class="six columns">
                        <ul class="link-list right">
                            <li><a href="/">Home</a></li>
                            <li><a href="/about">About</a></li>
                            <li><a href="/contact">Contact</a></li>
                            <li><a href="/blog">Blog</a></li>
                            <li><a href="/admin">Admin</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </footer>
    
        @* Modals *@
        @RenderSection("Modals", false)
        @Html.Partial("Partials/ContactSuccessModal")
        

        @* Use Google jquery CDN, with fallback to local *@
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
        <script>window.jQuery || document.write('<script src="/Scripts/jquery/jquery-1.8.2.min.js"><\/script>')</script>
        @{ 
            string scripts = SquishIt.Framework.Bundle.JavaScript()

                // jqueryui
                .Add("~/scripts/jqueryui/js/jquery-ui-1.9.2.custom.js")

                .Add("~/scripts/common.js")

                // Used in validating Contact Form
                .Add("~/scripts/jquery/plugins/jquery.validate.js")
                .Add("~/scripts/jquery/plugins/jquery.form.js")

                // Foundation Resources. Use only what you need
                .Add("~/scripts/foundation/jquery.foundation.alerts.js")
                .Add("~/scripts/foundation/jquery.foundation.buttons.js")
                .Add("~/scripts/foundation/jquery.foundation.forms.js")
                .Add("~/scripts/foundation/jquery.foundation.navigation.js")

                // You may move orbit out if you're not using a slider on the homepage
                .Add("~/scripts/foundation/jquery.foundation.orbit.js")

                .Add("~/scripts/foundation/jquery.foundation.reveal.js")
                .Add("~/scripts/foundation/jquery.foundation.tabs.js")
                .Add("~/scripts/foundation/jquery.foundation.tooltips.js")
                .Add("~/scripts/foundation/app.js")

                // Site Specific
                .Add("~/scripts/mcp.js")
                .Add("~/scripts/blog_class.js")

                //.ForceRelease() // Force Minification. Uncomment to minify
            .Render("~/scripts/combined_#.js");
        }
        @Html.Raw(scripts)

        @{
            // Load the text editor plugin and text editor modal for admins so they can edit content in place
            if (UserUtils.UserIsAdmin())
            {
                Html.RenderPartial("~/Areas/Admin/Views/Shared/AdminEditPartial.cshtml");
                
                <script src="/Scripts/foundation/jquery.foundation.mediaQueryToggle.js"></script>
                <script src="/Scripts/ckeditor/ckeditor.js"></script>
                <script src="/Areas/Admin/Scripts/adminContentEditor.js"></script>
            
                @* Add scripts for content editor in modal *@
                <script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
                <script src="/Scripts/jquery/plugins/dropzone/dropzone.js"></script>
                <script src="/Scripts/jquery/plugins/jquery.noty.js"></script>
                <script src="/Scripts/jquery/plugins/jquery.noty.layout.js"></script>
                <script src="/Scripts/jquery/plugins/jquery.noty.theme.js"></script>
                <script src="/Areas/Admin/Scripts/adminContentEditorModal.js"></script>
            
                <link href="/Scripts/jquery/plugins/dropzone/css/dropzone.css" type="text/css" rel="stylesheet">
                <link href="/Scripts/jquery/plugins/dropzone/css/basic.css" type="text/css" rel="stylesheet">
                <link href="/Areas/Admin/Content/themes/base/adminEdit.css" type="text/css" rel="stylesheet">
            
                @Html.DoAction("footer_logged_in")    
            }
        }

        @RenderSection("Scripts", false)
    
        @Html.DoAction("footer")    
</body>
</html>